program define ziop2, eclass
    version 10.1
    syntax varlist [if] [in], INFLate(varlist) [vce(passthru)] [CLuster(varname)] ///
        [robust] [TECHnique(passthru)] [difficult] 

    //  Separate the d.v. from i.v.(s).
    gettoken dv xvars : varlist

	if "`cluster'" != "" {
	local clopt cluster(`cluster')
       }
	if "`robust'" != "" {
	local vce = "robust"
       }	
    ml model lf ziop_lf                       ///
        (Beta:  `dv' = `xvars')               ///
        (Gamma:  `dv' = `inflate')            ///
        /cut2                                 ///
        /rho                                  ///
        , title(Zero-inflated Ordered Probit with correlated errors) ///
        `vce'		                      ///
        `clopt'
	`technique'
    ml maximize, `difficult'
end

